#pragma once
#include "Goods.h"

class GoodsManager {
  public:
    GoodsManager ();
    ~GoodsManager ();
    
  public:
    GoodsPtr getGoods(uint32_t code, bool createNew = false);
    
    GoodsPtr createGoods(uint32_t code);
    void getGoodsList(std::vector<GoodsPtr> &goodsList, int exchange,  int64_t categroy);
    
    void init();
    void reset();
    
  private:
    std::map<int, GoodsPtr> m_goods;
};

extern GoodsManager &getGoodsManager();
#define xGoodsManager getGoodsManager()